package cn.yuanqiao.archive.appManager.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 同义词对象 YQTYC
 *
 * @author yuanqiao
 * @date 2023-06-14
 */
public class YqTyc extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    private final String BIGTABLENAME = "_YQTYC";

    public YqTyc() {
        String yqtycCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(yqtycCode)){
//            throw new ServiceException("TenantCode is null");
            this.tableName = "YQTYC";
        }else {
            this.tableName = yqtycCode.toUpperCase()+BIGTABLENAME;
        }
    }

    private String tableName;

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    /** ID */
    @IdAnnotation
    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long id;

    /** 原词 */
//    @NotBlank(message = "原词不能为空！")
    @Excel(name = "原词")
    private String primary_word;

    /** 同义词 */
//    @NotBlank(message = "同义词不能为空！")
    @Excel(name = "同义词")
    private String tyc;

    /** 是否启用 */
    @Excel(name = "启用状态",readConverterExp = "0=未启用,1=已启用",combo="未启用,已启用")
    private Integer status;

    /** 创建人 */
//    @Excel(name = "创建人")
    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long creator_id;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
//    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date create_time;

    /** 最后修改人 */
//    @Excel(name = "最后修改人")
    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long lastupdater;

    /** 最后修改时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
//    @Excel(name = "最后修改时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastupdate_time;

    /** 是否删除 */
//    @Excel(name = "是否删除",readConverterExp = "0=未删除,1=已删除")
    private Integer is_del;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getPrimary_word() {
        return primary_word;
    }

    public void setPrimary_word(String primary_word) {
        this.primary_word = primary_word;
    }

    public String getTyc() {
        return tyc;
    }

    public void setTyc(String tyc) {
        this.tyc = tyc;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getCreator_id() {
        return creator_id;
    }

    public void setCreator_id(Long creator_id) {
        this.creator_id = creator_id;
    }

    public Date getCreate_time() {
        return create_time;
    }

    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }

    public Long getLastupdater() {
        return lastupdater;
    }

    public void setLastupdater(Long lastupdater) {
        this.lastupdater = lastupdater;
    }

    public Date getLastupdate_time() {
        return lastupdate_time;
    }

    public void setLastupdate_time(Date lastupdate_time) {
        this.lastupdate_time = lastupdate_time;
    }

    public Integer getIs_del() {
        return is_del;
    }

    public void setIs_del(Integer is_del) {
        this.is_del = is_del;
    }

    @Override
    public String toString() {
        return "YqTyc{" +
                "id=" + id +
                ", primary_word='" + primary_word + '\'' +
                ", tyc='" + tyc + '\'' +
                ", status=" + status +
                ", creator_id=" + creator_id +
                ", create_time=" + create_time +
                ", lastupdater=" + lastupdater +
                ", lastupdate_time=" + lastupdate_time +
                ", is_del=" + is_del +
                '}';
    }
}
